#ifndef XML_UTIL_HH
#define XML_UTIL_HH

#include <map>
#include <string>
#include "tinyxml2.h"

class CXmlUtil
{
public:
	CXmlUtil();
	virtual~CXmlUtil();

	virtual int GetNumChannel();
	virtual int GetAllChannels();

	virtual int ParseXml(const char* xml);
	virtual int ParseFile(const char* FilePath);
	virtual int find(const char* key,const char* val) const;

	virtual int GetFieldInt(const char* fieldName) const;
	virtual const char* GetFieldString(const char* fieldName) const;
	virtual int GetFieldValue(const char* fieldName, char* fieldvalue) const;
private:
	
	tinyxml2::XMLDocument* m_xmlParse;
	std::map<std::string, std::string> m_MapField;
	void xParseFunc(tinyxml2::XMLElement* hItem, std::string text, bool bRepeat);
};

#endif


